package com.rm.zeyou.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.rm.zeyou.entity.User;
import com.rm.zeyou.response.ApiRestResponse;
import com.rm.zeyou.service.UserConsumeDetailService;
import com.rm.zeyou.util.login.LoginUtil;
import com.rm.zeyou.vo.request.SelectUserConsumptionListVo;
import com.rm.zeyou.vo.response.SelectUserConsumptionListResponseBaseVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 用户消费记录表 前端控制器
 * </p>
 *
 * @author YanYang
 * @since 2025-03-12 15:55:09
 */
@Api(tags = "用户消费记录相关")
@RestController
@RequestMapping("/api/userConsumeDetail")
public class UserConsumeDetailController {
    @Resource
    private UserConsumeDetailService userConsumeDetailService;
    @Resource
    private LoginUtil loginUtil;


    @ApiOperation("用户消费记录列表")
    @PostMapping("selectUserConsumptionList")
    @SaCheckLogin(type = "user")
    public ApiRestResponse<SelectUserConsumptionListResponseBaseVo> selectUserConsumptionList(@RequestBody SelectUserConsumptionListVo requestVo){
        User user = loginUtil.getUser();
        return userConsumeDetailService.selectUserConsumptionList(user,requestVo);
    }
}
